import re
import requests
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
import unicodedata
import urllib3

# 禁用安全警告
requests.packages.urllib3.disable_warnings()
headers = {
    'User-Agent': UserAgent().chrome
}

url = 'https://music.douban.com/chart'

res = requests.get(url,headers=headers,verify=False)
soup = BeautifulSoup(res.text,'lxml')
src = str(soup.find_all(attrs={"class":"col5"}))
pattern = re.compile('<li.*?"green-num-box">(.*?)</span>.*?<a href="javascript:;">(.*?)</a>.*?<p>(.*?)</p>',re.S | re.I)
items = re.findall(pattern, src)
for item in items:
    for thing in item:
        print(thing)
    # unicodedata.normalize('NFKD',item)